@extends('layouts.app') @section('content')
<div class="container">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            @if (count($errors) > 0)
            <div class="alert alert-danger">
                {!! implode('
                <br>', $errors->all()) !!}
            </div>
            @endif
            <div><img class="category-home-title" src="/lv5/public/img/paper.png" alt=""></div>
            <ul id="index-articles">
                @foreach ($papers as $paper)
                <hr style="margin: 5px 0; width:100%; height:5px;">
                <li style="margin: 40px 0; list-style:none;">
                    <div class="row">
                        <div class="col-md-8 col-xs-7">

                            <div class="title">
                                <h4>
                                    <a class="article-title" href="{{ url('paper/'.$paper->id) }}">
                                        {{ $paper->title }}
                                    </a>
                                </h4>
                            </div>
                            <div class="body">
                                <p>{{ mb_substr($paper->body, 0, 150).'...'}}</p>
                            </div>
                            <div>
                                阅读&nbsp;
                                <span>({{$paper->read_total}})</span> &nbsp;&nbsp;&nbsp;回复&nbsp;
                                <span>{{ $paper->reply_total }}</span>
                                &nbsp;&nbsp;&nbsp;点赞&nbsp;
                                <span>{{ $paper->upvote_total }}</span>
                            </div>
                        </div>
                        <div class="col-md-4 col-xs-5">
                            <a href="{{ url('paper/'.$paper->id) }}">
                                <img class="img-responsive article-cover" src="/lv5/public/img/cover/{{$paper->cover_img}}" alt="">
                            </a>
                        </div>
                    </div>
                </li>
                @endforeach
            </ul>

        </div>
    </div>
    @endsection